package com.msdemo.eureka;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.expression.ParserContext;

@EnableEurekaServer
@SpringBootApplication
public class MicroSrvDemoEurekaServer {
	private static Class<?> cla = MicroSrvDemoEurekaServer.class;
	private static Logger logger = LogManager.getLogger(cla);
	
	public static void main(String[] args) {
		ConfigurableApplicationContext cofigAppCont = SpringApplication.run(cla, args);
		ConfigurableEnvironment confEnv = cofigAppCont.getEnvironment();
		String host = confEnv.getProperty("eureka.instance.hostname");
		String port = confEnv.getProperty("server.port");
		//System.out.println("MSDemoEurekaServer started on " + host + ":" + port + " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
		logger.info("MSDemoEurekaServer started on {}:{} >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", host, port);
	}

}
